import java.lang.reflect.Field;
import java.lang.reflect.Method;


public class TestReflect {
	public static void main (String argv[] ) {
		Object o = new Data ("test", 1);
		
		Method[] methods = o.getClass().getDeclaredMethods();
		System.out.println("method:");
		for (Method methed : methods) {
		 
		    System.out.println(methed);
		 
		    System.out.println(methed.getName());
		 
		} 
		
		Field[] fields = o.getClass().getDeclaredFields();
		System.out.println("member:");
		for (Field field : fields) {
		 
		     System.out.println(field);
		     
		     System.out.println(field.getName());
		     try {
		    	 field.setAccessible(true);
				System.out.println(field.get(o));
			} catch (IllegalArgumentException | IllegalAccessException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
	}
}